<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base href="<%=basePath%>">
		<!--[if lte IE 6]></base><![endif]-->
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="keywords"
			content="学生综合信息管理平台,学生,综合,信息,管理,管理平台,学生综合,综合信息,学生平台,广东科学技术职业学院,科干,管理平台,学生信息管理,信息管理平台,学生信息网站,学生信息管理网站,科学技术,广科,广科院,广科院学生信息管理,广科院学生综合信息" />
		<title>学生综合信息管理平台</title>
		<link href="images/logo-copy.ico" rel="shortcut icon"
			type="image/x-icon" />
		<link href="css/menu.css" rel="stylesheet" type="text/css" />
		<link href="css/index.css" rel="stylesheet" type="text/css" />
		<link href="css/jquery-ui-1.8.16.custom.css" rel="stylesheet"
			type="text/css" />
		<link href="css/paging.css" rel="stylesheet" type="text/css" />
		<script language="javascript" type="text/javascript"
			src="javascript/jquery-1.6.4.js">
</script>
		<script language="javascript" type="text/javascript"
			src="javascript/jquery-ui-1.8.16.custom.min.js">
</script>
		<script language="javascript" type="text/javascript"
			src="javascript/jquery.bgiframe.js">
</script>
		<script language="javascript" type="text/javascript"
			src="javascript/common.js">
</script>

		<script type='text/javascript'
			src='dwr/interface/dormManagerAction.js'>
</script>
		<script type='text/javascript' src='dwr/engine.js'>
</script>

		<script type='text/javascript' src='dwr/util.js'>
</script>


		<script language="javascript" type="text/javascript">

function queryClassDorm(){
	dormManagerAction.loadClassDormDetail($("#className").val(),fillData)
}

//填充查询结果
function fillData(classInfo) {
	var classInfoDiv=$("#classDormDetailsTable");//显示班级总体概况的div

	//显示班级总体概况
	classInfoDiv.find("h2[name='className']").html(dealNULLData(classInfo.className+"班"));
	classInfoDiv.find("td[name='teacherName']").html(dealNULLData(classInfo.teacherName));//班主任姓名
	classInfoDiv.find("td[name='teacherPhone']").html(dealNULLData(classInfo.teacherPhone));//班主任电话*/
	if(classInfo.monitor){//班长信息不为空
		classInfoDiv.find("td[name='monitorName']").html(dealNULLData(classInfo.monitor.studentName));//班长姓名
		classInfoDiv.find("td[name='monitorPhone']").html(dealNULLData(classInfo.monitor.mobile));//班长电话
	}else{//班长信息为空
		classInfoDiv.find("td[name='monitorName']").html('<font color="red">不详</font>');//班长姓名
		classInfoDiv.find("td[name='monitorPhone']").html('<font color="red">不详</font>');//班长电话
	}
	
	classInfoDiv.find("td[name='studentCount']").html(classInfo.studentCount);//班级总人数
	classInfoDiv.find("td[name='maleCount']").html(classInfo.maleCount);//男生数
	classInfoDiv.find("td[name='femaleCount']").html(classInfo.femaleCount);//女生数
	
	//显示宿舍情况
	
	
	var  dormInfoDiv=$("#resultDataDiv");//显示整个班宿舍情况的div
	var table=dormInfoDiv.find("table");
	var dormInfoTr=table.find("tr:eq(1)");//显示一个宿舍情况的表格行
	table.find("tr:gt(0)").remove()
	for(var i=0;i<classInfo.dormVos.length;i++){
		var dorm=classInfo.dormVos[i];
		var tr=dormInfoTr.clone();
		if(dorm.sex){//男生宿舍 
			tr.find("td[name='sexLogo']").attr("src","images/sex0.png")
			tr.find("td[name='sex']").html("男");
		}else{//女生宿舍
			tr.find("img[name='sexLogo']").attr("src","images/sex1.png")
			tr.find("td[name='sex']").html("女");
		}
		tr.find("td[name='index']").html(i+1);
		tr.find("td[name='dormNumber']").html(dorm.dormNumber);
		tr.find("td[name='bedRest']").html(dorm.bedRest);
		tr.find("td[name='bedNumber']").html(dorm.dormBedNumber);
		tr.find("td[name='studentList']").html('<font color="red">没有学生入住</font>');
		
		if(dorm.students){//宿舍有学生入住
			var studentList="";
			for(var j=0;j<dorm.students.length;j++){
				var student=dorm.students[j];
				var studentInfo='{studentName:'+student.studentName+',studentId:'+student.studentId+'}';
				studentList+='<a href="javascript:showStudentInfo(\''+studentInfo+'\')">'+student.studentName+"</a>&nbsp;&nbsp;";
			}
			tr.find("td[name='studentList']").html(studentList);
		}
		
		
		
		table.append(tr);
	}
}
function showStudentInfo(stu){
	alert(eval(stu))
	/*$("#stu_className").html(className);
	$("#stu_sex").html(sex);
	$("#studentNumber").html(studentNumber);
	$("#s").html(className);
	
	$("#showStudentInfoDiv").dialog();*/
	
}
//处理空值
function dealNULLData(data){
	if(data==null||data==""){
		return '<font color="red">不详</font>'
	}
	return data;
}
</script>
	</head>
	<body>
		<jsp:include page="../common/header.jsp"></jsp:include>

		<div id="menu">
			<div id="mainMenuDiv">
				<ul>
					<li>
						<a href="#">教师信息管理</a>
					</li>
					<li>
						<a href="#">学生信息管理</a>
					</li>
					<li>
						<a href="web/studentInformationBasic.jsp">个人信息管理</a>
					</li>
					<li>
						<a href="web/logisticsSearchDorm.jsp">后勤管理</a>
					</li>
					<li>
						<a href="web/scoreSearch.jsp">成绩管理</a>
					</li>
					<li>
						<a href="web/attendanceSearch.jsp">考勤管理</a>
					</li>
				</ul>
			</div>

			<div id="minorMeun">
				<ul>
					<li>
						<a href="web/logisticsSearchDorm.jsp">宿舍查询</a>
					</li>
					<li>
						<a href="web/logisticsImportDorm.jsp">宿舍导入</a>
					</li>
					<li>
						<a href="web/logisticsDormOfClass.jsp">班级宿舍管理</a>
					</li>
				</ul>
			</div>

		</div>
		<div id="bodyDiv">
			<div id="bodyTitleDiv">
				<div id="breadcrumbDiv">
					当前位置
					<a href="web/index.jsp">：首页</a>>
					<a href="web/logisticsSearchDorm.jsp">后勤管理</a>>
					<a href="web/logisticsSearchDorm.jsp">班级宿舍管理</a>
				</div>
			</div>
			<div id="bodyCentreDiv">
				<div id="conditionDiv">
					请输入班级:<input type="text" id="className"/>
					<input type="button" value="查询" onclick="queryClassDorm()"/>
					<span style="font-size: 12px;color: red">*班级格式如09accp2</span>
				</div>
				<div id="waitDiv">
					<img src="images/loading1.gif" />
					查询中...
				</div>
			
				<div id="totalResult">
				<div id="resultDiv">
					<div id="resultTitleDiv">
						查询结果：

						<div id="classDormDetailsTable">
							<h2 align="center" name="className">
								
							</h2>
							<table style="margin: auto; width: 80%">

								<tr>
									<td class="table_title">
										班主任:
									</td>
									<td class="table_readonly" name="teacherName">
										陈XX
									</td>
									<td class="table_title">
										班主任电话:
									</td>
									<td class="table_readonly" name="teacherPhone">
										13750042858
									</td>
									<td class="table_title">
										班长:
									</td>
									<td class="table_readonly" name="monitorName">
										XXXX
									</td>
									<td class="table_title">
										班长手机：
									</td>
									<td class="table_readonly" name="monitorPhone">
										13750042858
									</td>
								</tr>
								<tr>
									<td class="table_title">
										班级总人数：
									</td>
									<td class="table_readonly" name="studentCount">
										60
									</td>
									<td class="table_title">
										男生数：
									</td>
									<td class="table_readonly" name="maleCount">
										30
									</td>
									<td class="table_title">
										女生数:
									</td>
									<td class="table_readonly" name="femaleCount">
										30
									</td>
									<td>
										&nbsp;
									</td>
									<td>
										&nbsp;
									</td>
								</tr>

							</table>
						</div>
					</div>
					<div id="resultDataDiv">
						<table cellspacing="1" class="contentTable" id="classDormTable" >
							<tr>
								<th width="4%">
									&nbsp;
								</th>
								<th>
									序号
								</th>
								<th>
									宿舍
								</th>
								<th>
									性别
								</th>
								<th>
									空床位数
								</th>
									<th>
									总床位数
								</th>
								<th>
									入住学生
								</th>
							</tr>
							<tr>
								<td width="4%" >
									<img src="images/sex0.png" alt="" width="27" height="23"  name="sexLogo"/>
								</td>
								<td name="index">
									1
								</td>
								<td name="dormNumber">
									23#504
								</td>
								<td name="sex">
									男
								</td>
								<td name="bedRest">
									0
								</td>
								<td name="bedNumber">
									0
								</td>
								<td name="studentList">
									刘日斯、刘日斯、刘日斯、刘日斯
								</td>
							</tr>
							
							
						</table>
						<div id="allDataDiv">
							共
							<samp>
								10
							</samp>
							页&nbsp;&nbsp;共
							<samp>
								100
							</samp>
							条数据
						</div>
						<div id="pagingD">
							<a href="#">上一页</a>
							<a href="#">1</a>
							<a href="#">2</a>
							<a href="#">3</a>
							<a href="#">下一页</a>
							<select>
								<option>
									页数
								</option>
								<option>
									1
								</option>
								<option>
									2
								</option>
								<option>
									3
								</option>
								<option>
									4
								</option>
								<option>
									5
								</option>
								<option>
									6
								</option>
								<option>
									7
								</option>
								<option>
									8
								</option>
							</select>
							<input type="button" value="跳转" />
						</div>
					</div>
					<!---点击学生名字 弹出详细信息 下面Div是弹出框 id为attendanceStudenTdetailsDiv-->
		          	<div id="attendanceStudenTdetailsDiv" style="display:none;">
		            	<table cellspacing="10" class="table_popup1">
		                  <tr>
		                    <th colspan="8">学生简要信息</th>
		                    </tr>
		                  <tr>
		                    <td class="table_title">班&nbsp;&nbsp;&nbsp;&nbsp;级：</td>
		                    <td class="table_readonly"><input type="text" value="10UI设计2班" size="12" maxlength="12" readonly="readonly"/></td>
		                    <td class="table_title">学&nbsp;&nbsp;&nbsp;&nbsp;号：</td>
		                    <td class="table_readonly"><input type="text" value="0104100716" size="12" maxlength="10" readonly="readonly"/></td>
		                    <td class="table_title">姓&nbsp;&nbsp;&nbsp;&nbsp;名：</td>
		                    <td class="table_readonly"><input type="text" value="刘日斯" size="12" maxlength="6" readonly="readonly"/></td>
		                    <td class="table_title">性&nbsp;&nbsp;&nbsp;&nbsp;别：</td>
		                    <td class="table_readonly"><input type="text" value="男" size="12" maxlength="1" readonly="readonly"/></td>
		                  </tr>
		                  <tr>
		                    <td class="table_title">宿&nbsp;&nbsp;&nbsp;&nbsp;舍：</td>
		                    <td class="table_readonly"><input type="text" value="3#504" size="12" maxlength="6" readonly="readonly"/></td>
		                    <td class="table_title">联系手机：</td>
		                    <td class="table_readonly"><input type="text" value="11111111111" size="12" maxlength="11" readonly="readonly"/></td>
		                    <td class="table_title">Q&nbsp;&nbsp;Q：</td>
		                    <td class="table_readonly"><input type="text" value="61955365" size="12" maxlength="12" readonly="readonly"/></td>
		                    <td class="table_title">E-mail：</td>
		                    <td class="table_readonly"><input type="text" value="61955365@qq.com" size="18" readonly="readonly"/></td>
		                  </tr>
		                </table>
		            </div>
		            <!---点击学生名字 弹出详细信息 下面Div是弹出框 id为attendanceStudenTdetailsDiv  结束-->
				</div>
			</div>
			</div>
		</div>
		<div id="showStudentInfoDiv">
			<table>
				<tr>
					<td>姓名</td>
					<td id="studentName"></td>
					<td>学号</td>
					<td id="studentNumber"></td>
					<td>性别</td>
					<td id="stu_sex"></td>
					<td >班级</td>
					<td id="stu_className"></td>
				</tr>
			</table>
		</div>
		<jsp:include page="../common/footer.jsp"></jsp:include>
	</body>
</html>

